

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.scalar.chiptrack.users.Functionality,
                 com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants"%>
<%@ page import="com.scalar.chiptrack.users.User" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/jsp/admin/admin.jsp"/>

<%--<html:html locale="true">--%>

<html><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext(); %>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script language='javascript'>

    function save()
    {
        var form = document.accountsSetupForm;
        var errors = '';


        if(form.accountsReceivableAccount.value.trim == '' || form.accountsReceivableAccount.value.length == 0 )
        {
            errors = errors + "<li>Enter Accounts Receivable Account</li>";
            form.accountsReceivableAccount.focus();
        }
        if(form.distributorGeneralAccount.value.trim == '' || form.distributorGeneralAccount.value.length == 0 )
        {
            errors = errors + "<li>Enter Distributor G/L Account</li>";
            form.distributorGeneralAccount.focus();
        }
        if(form.customerGeneralAccount.value.trim == '' || form.customerGeneralAccount.value.length == 0 )
        {
            errors = errors + "<li>Enter Customer G/L Account </li>";
            form.customerGeneralAccount.focus();
        }
        if(form.soFileLoaction.value.trim == '' || form.soFileLoaction.value.length == 0 )
        {
            errors = errors + "<li>Enter SO File Location </li>";
            form.soFileLoaction.focus();
        }
        if(form.soFileName.value.trim == '' || form.soFileName.value.length == 0 )
        {
            errors = errors + "<li>Enter SO File Name </li>";
            form.soFileName.focus();
        }
        if(form.accountsPaybleAccount.value.trim == '' || form.accountsPaybleAccount.value.length == 0 )
        {
            errors = errors + "<li>Accounts Payable Account</li>";
            form.accountsPaybleAccount.focus();
        }
        if(form.generalAccount.value.trim == '' || form.generalAccount.value.length == 0 )
        {
            errors = errors + "<li>Enter G/L Account </li>";
            form.generalAccount.focus();
        }
         if(form.poFileLocation.value.trim == '' || form.poFileLocation.value.length == 0 )
        {
            errors = errors + "<li>Enter PO File Location </li>";
            form.poFileLocation.focus();
        }
        if(form.poFileName.value.trim == '' || form.poFileName.value.length == 0 )
        {
            errors = errors + "<li>Enter PO File Name</li>";
            form.poFileName.focus();
        }

        if (errors != '')
        {
            var pa1 = document.getElementById("info");
            pa1.innerHTML = "";
            var pa = document.getElementById("errors");
            pa.innerHTML = errors;
            return;
        }

        form.action.value="save";
        form.submit();
    }


</script>

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TR>
        <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
            <%@ include file="/jsp/admin/admin_menu.jsp" %>
            <!-- end of the side navigations -->
        </td>
        <TD bgcolor="#ffffff">
        <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></IMG></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
        <TD valign="top" width="100%">
            <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0></IMG>
        <BR>
        <!-- BODY STARTS HERE -->
        <center><span class="NArialW">Accounts Setup</span></center>
        <html:form name="accountsSetupForm" type="com.scalar.chiptrack.accountsetup.forms.AccountsSetupForm" action="/accountsSetup">
            <input type="hidden" name="action" value="<%= (String)request.getAttribute("action")%>">
            <table border="0" width="85%" bordercolor="black" align=center>
            <tr><td colspan='4'><FONT id="info"><chiptrack:info styleClass="NArialL" /></FONT></td></tr>
            <tr><td colspan='4'><chiptrack:errors styleClass="NArialL" /></td></tr>
            <logic:equal name="showMessage" value="TRUE">
                <tr><td colspan=4 align='left'>
                <font class='NArialS'>
                <font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b>
                </font></font></td></tr>
            </logic:equal>
	        <tr><td  colspan="4" class='NArialL'><FONT id="errors" styleClass="NArialL" color='FF0000'></FONT></TD></TR>
            <tr>
            <td width="20%" bgcolor="#DEE1E2" colspan='5' ><font class="NArialL" >Sales Orders</font></td></tr>
            <TR><TD bgcolor="#ffffff"><IMG height=5 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD></tr>
            <tr>
                <td class="NArialL" align="left">Accounts Receivable Account :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='accountsReceivableAccount' styleClass='txfield' maxlength="50"/></td>
            </tr>
            <tr>
                <td  class="NArialL" align="left">Distributor G/L Account :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='distributorGeneralAccount' styleClass='txfield' maxlength="50"/></td>
                <td class="NArialL" align="left">Customer G/L Account :<font color="red">*</font> </td>
                <td><html:text name='accountsSetupForm' property='customerGeneralAccount' styleClass='txfield' maxlength="50"/></td>
            </tr>
            <tr>
                <td  class="NArialL" align="left">SO File Location :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='soFileLoaction' styleClass='txfield' maxlength="50"/></td>
                <td class="NArialL" align="left">SO File Name :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='soFileName' styleClass='txfield' maxlength="50"/></td>
            </tr>
            <TR><TD bgcolor="#ffffff"><IMG height=5 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD></tr>
            <TR><td width="20%" bgcolor="#DEE1E2" colspan='4' ><font class="NArialL" >Purchase Orders</font></td></tr>
            <TR><TD bgcolor="#ffffff"><IMG height=5 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD></tr>
            <tr>
                <td  class="NArialL" align="left">Accounts Payable Account :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='accountsPaybleAccount' styleClass='txfield' maxlength="50"/></td>
                <td class="NArialL" align="left">G/L Account :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='generalAccount' styleClass='txfield' maxlength="50"/></td>
            </tr>
            <tr>
                <td  class="NArialL" align="left">PO File Location :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='poFileLocation' styleClass='txfield' maxlength="50"/></td>
                <td class="NArialL" align="left">PO File Name :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='poFileName' styleClass='txfield' maxlength="50"/></td>
            </tr>
            <TR><TD bgcolor="#ffffff"><IMG height=15 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD></tr>            
            <tr>
                <td  class="NArialL" align="left">PO Receipt File Location :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='poReceiptFileLocation' styleClass='txfield' maxlength="50"/></td>
                <td class="NArialL" align="left">PO Receipt File Name :<font color="red">*</font></td>
                <td><html:text name='accountsSetupForm' property='poReceiptFileName' styleClass='txfield' maxlength="50"/></td>
            </tr>
            <TR><TD bgcolor="#ffffff"><IMG height=15 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD></tr>
            <tr>
                <td colspan='2' align="right">
                    <chiptrack:restrictedLink functionality='<%=Functionality.ACCOUNTS_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:save();' onmouseover="window.status='Click to save Account SetUp Information';return true" onmouseout="window.status='';return true">
                    <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" title='Click to save Accounts SetUp Information'/>
                    </chiptrack:restrictedLink>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
                <td  align="left"><a href="javascript:document.accountsSetupForm.reset();" onMouseOver="window.status='Click to reset ';return true" onMouseOut="window.status='';return true" title="Click here to Reset"/>
                <img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif"/></td>
            </tr>
        </table>
        <!-- BODY ENDS HERE -->
<!--<BR><BR><BR>--> </TD>
       <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
    </TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</html:form>
</body>
</html>

